﻿@model ShenLanCMS.Models.Post
@{
    ViewBag.Title = "编辑文章";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>编辑文章</legend>
        @Html.HiddenFor(model => model.PostID)
        @Html.HiddenFor(model => model.AddUserID)
        @Html.HiddenFor(model => model.PubTime)
        @Html.HiddenFor(model => model.DigBad)
        @Html.HiddenFor(model => model.DigGood)
        @Html.HiddenFor(model => model.Click)
        @Html.HiddenFor(model => model.Status)
        @Html.HiddenFor(model => model.DigGood)
        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PostTypeID)
        </div>
        <div class="editor-field">
            @Html.DropDownList("PostTypeID")
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Tag)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Tag)
            @Html.ValidationMessageFor(model => model.Tag)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Keyword)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Keyword)
            @Html.ValidationMessageFor(model => model.Keyword)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Content)
        </div>
        <div class="editor-field">
            <textarea name="Content" id="Content">@Model.Content</textarea>
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.FileName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FileName)
            @Html.ValidationMessageFor(model => model.FileName)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Weight)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Weight)
            @Html.ValidationMessageFor(model => model.Weight)
        </div>
        <p>
            <input type="submit" value="保存" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("返回列表", "Index")
</div>
<script src="../../Addons/kindeditor/kindeditor-min.js" type="text/javascript"></script>
<script src="../../Addons/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script>
    var editor;
    KindEditor.ready(function (K) {
        editor = K.create('textarea[name="Content"]', {
            uploadJson: '../../Addons/kindeditor/asp.net/upload_json.ashx',
            fileManagerJson: '../../Addons/kindeditor/asp.net/file_manager_json.ashx',
            allowFileManager: true,
            width: 680,
            height: 360
        });
    });
</script>
